home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 2000 April / Disc 1 / APC541.ISO / workshop / c / tstack.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-02-12  |  782 b   |  32 lines

  1. // **************************************************************
  2. // tstack.cpp
  3. // Example program for Simple C++
  4. //
  5. // (c) 2000 Emmenjay Consulting Pty Ltd                          
  6. //                                                               
  7. // History                                                       
  8. // 12/02/2000 MJS  Initial Coding.                                 
  9. //                                                               
  10. // **************************************************************
  11.  
  12. #include <iostream>
  13. #include "tstack.h"
  14. using namespace std;
  15.  
  16. int main()
  17. {
  18.   TStack<int> s(50);
  19.   int val;
  20.  
  21.   do {
  22.     cin >> val;
  23.     s.Push( val );
  24.   } while (val!=0);
  25.  
  26.   while (s.Pop( val ))
  27.     cout << val << '\n';
  28.   return 0;
  29. }
  30.  
  31.  
  32.